#!/usr/local/bin/ruby

(k, n) = ARGV.map { |s| s.to_i }
n.times do |i|
   r = rand * (n - i)
   unless (k < r)
      puts i
      k -= 1
   end
end
